3.824 \(\int \frac{(-a-b x)^{-n} (a+b x)^n}{x} \, dx\)

Optimal. Leaf size=22 \[ \log (x) (-a-b x)^{-n} (a+b x)^n \]

[Out]

((a + b*x)^n*Log[x])/(-a - b*x)^n

________________________________________________________________________________________

Rubi [A]  time = 0.0042418, antiderivative size = 22, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.087, Rules used = {23, 29} \[ \log (x) (-a-b x)^{-n} (a+b x)^n \]

Antiderivative was successfully verified.

[In]

Int[(a + b*x)^n/(x*(-a - b*x)^n),x]

[Out]

((a + b*x)^n*Log[x])/(-a - b*x)^n

Rule 23

Int[(u_.)*((a_) + (b_.)*(v_))^(m_)*((c_) + (d_.)*(v_))^(n_), x_Symbol] :> Dist[(a + b*v)^m/(c + d*v)^m, Int[u*
(c + d*v)^(m + n), x], x] /; FreeQ[{a, b, c, d, m, n}, x] && EqQ[b*c - a*d, 0] &&  !(IntegerQ[m] || IntegerQ[n
] || GtQ[b/d, 0])

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rubi steps

\begin{align*} \int \frac{(-a-b x)^{-n} (a+b x)^n}{x} \, dx &=\left ((-a-b x)^{-n} (a+b x)^n\right ) \int \frac{1}{x} \, dx\\ &=(-a-b x)^{-n} (a+b x)^n \log (x)\\ \end{align*}

Mathematica [A]  time = 0.0024547, size = 22, normalized size = 1. \[ \log (x) (-a-b x)^{-n} (a+b x)^n \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*x)^n/(x*(-a - b*x)^n),x]

[Out]

((a + b*x)^n*Log[x])/(-a - b*x)^n

________________________________________________________________________________________

Maple [C]  time = 0.026, size = 56, normalized size = 2.6 \begin{align*} \ln \left ( x \right ) \left ( bx+a \right ) ^{n}{{\rm e}^{-n \left ( i\pi \, \left ({\it csgn} \left ( i \left ( bx+a \right ) \right ) \right ) ^{3}-i\pi \, \left ({\it csgn} \left ( i \left ( bx+a \right ) \right ) \right ) ^{2}+i\pi +\ln \left ( bx+a \right ) \right ) }} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x+a)^n/x/((-b*x-a)^n),x)

[Out]

ln(x)*(b*x+a)^n*exp(-n*(I*Pi*csgn(I*(b*x+a))^3-I*Pi*csgn(I*(b*x+a))^2+I*Pi+ln(b*x+a)))

________________________________________________________________________________________

Maxima [A]  time = 1.22875, size = 8, normalized size = 0.36 \begin{align*} \left (-1\right )^{n} \log \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^n/x/((-b*x-a)^n),x, algorithm="maxima")

[Out]

(-1)^n*log(x)

________________________________________________________________________________________

Fricas [A]  time = 1.86752, size = 24, normalized size = 1.09 \begin{align*} \cos \left (\pi n\right ) \log \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^n/x/((-b*x-a)^n),x, algorithm="fricas")

[Out]

cos(pi*n)*log(x)

________________________________________________________________________________________

Sympy [C]  time = 28.6126, size = 46, normalized size = 2.09 \begin{align*} \begin{cases} e^{- i \pi n} \log{\left (-1 + \frac{b \left (\frac{a}{b} + x\right )}{a} \right )} & \text{for}\: \frac{\left |{b \left (\frac{a}{b} + x\right )}\right |}{\left |{a}\right |} > 1 \\e^{- i \pi n} \log{\left (1 - \frac{b \left (\frac{a}{b} + x\right )}{a} \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)**n/x/((-b*x-a)**n),x)

[Out]

Piecewise((exp(-I*pi*n)*log(-1 + b*(a/b + x)/a), Abs(b*(a/b + x))/Abs(a) > 1), (exp(-I*pi*n)*log(1 - b*(a/b +
x)/a), True))

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (b x + a\right )}^{n}}{{\left (-b x - a\right )}^{n} x}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^n/x/((-b*x-a)^n),x, algorithm="giac")

[Out]

integrate((b*x + a)^n/((-b*x - a)^n*x), x)